]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspacesView: Don't update secondary monitor thumbnails box if hidden
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 12 May 2021 14:55:34 +0000 (11:55 -0300)
committerMarge Bot <marge-bot@gnome.org>
Wed, 12 May 2021 18:08:55 +0000 (18:08 +0000)
And save quite a few C/JS trampolines. Since the thumbnails box may not
have up-to-date properties, call _updateThumbnailParams() right after
showing the thumbnails box.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1845>

js/ui/workspacesView.js

index c2d023cc4f2c6d07fd7986fa55027317d52ef7d7..6aa8b2615bce57223d64d014c5e0e4cf7209e2c9 100644 (file)
@@ -777,6 +777,7 @@ class SecondaryMonitorDisplay extends St.Widget {
             return;
 
         this._thumbnails.show();
+        this._updateThumbnailParams();
         this._thumbnails.ease_property('expand-fraction', visible ? 1 : 0, {
             duration: OverviewControls.SIDE_CONTROLS_ANIMATION_TIME,
             mode: Clutter.AnimationMode.EASE_OUT_QUAD,
@@ -785,6 +786,9 @@ class SecondaryMonitorDisplay extends St.Widget {
     }
 
     _updateThumbnailParams() {
+        if (!this._thumbnails.visible)
+            return;
+
         const { initialState, finalState, progress } =
             this._overviewAdjustment.getStateTransitionParams();